var myBank;
function bankOpen() {
    var temp = new Date();
    var myDate = temp.format("mmddyy")
    var url = '//ismybankopentoday.com/api/'
    $.post(url+myDate,function() { 
    console.log(myBank);});
}

function initSubs(myArr) {
    myArr.push('Vocloid,HollowPoint');
    myArr.push('JPOP,Dubstep');
    myArr.push('Jigoku Shoujo,Clannad');
    myArr.push('Visual Novel,FPS');
    myArr.push('Sublime Text,Emacs');
    myArr.push('Backtrack,Windows 8');
    myArr.push('Good,Bad');
    myArr.push('Boring,Interesting');
    myArr.push('Mecha,Romance');
    myArr.push('Bump of Chicken,Opeth');
    myArr.push('Girls Generation,Excision');
    myArr.push('Drunk,Sober');
    myArr.push('Boston,Houston');
    myArr.push('Audio,Video');
    myArr.push('Miku,J:KENZO');
    myArr.push('Python,C++');
    myArr.push('DoTA 2,Dystopia');
    myArr.push('Atlas,P-Body');
    myArr.push('Gordon,Breene');
    myArr.push('Good,Evil');
    myArr.push('Right,Wrong');
    myArr.push('Indie,Mainstream');
    myArr.push('AMD,Intel');
    myArr.push('Nvidia,ATi');
    myArr.push('Goth Girls,Asian Girls');
    myArr.push('Asurans,Humans');
    myArr.push('Blue,Red');
    myArr.push('Fire,Air');
    myArr.push('Green Monster Energy,Vodka and Redbull');
    myArr.push('Vodka,Whisky');
    myArr.push('dwm,Gnome 2');
    return myArr;
}
subArray = new Array();
subArray = initSubs(subArray);
function pickSubtitle() {
    var randomnumber=Math.floor((Math.random()*subArray.length));
    var temp = subArray[randomnumber];
    var n = temp.split(',');
    return 'Fr<a href="http://dealwithit.net/">o</a>m ' + n[0] + ' to ' + n[1];
}
/*function get_nth_suffix(date) {
    switch (date) {
    case 1:
    case 21:
    case 31:
        return 'st';
    case 2:
    case 22:
        return 'nd';
    case 3:
    case 23:
        return 'rd';
    default:
        return 'th';
    }
}*/
function addGradient(elem) {
    elem.css('background','rgba(218,108,37,1);');
    elem.css('background',' -moz-linear-gradient(top, rgba(218,108,37,1) 0%, rgba(255,175,75,0) 90%)');
    elem.css('background','-webkit-gradient(left top, left bottom, color-stop(0%, rgba(218,108,37,1)), color-stop(90%, rgba(255,175,75,0)))');
    elem.css('background','-webkit-linear-gradient(top, rgba(218,108,37,1) 0%, rgba(255,175,75,0) 90%)');
    elem.css('background','-o-linear-gradient(top, rgba(218,108,37,1) 0%, rgba(255,175,75,0) 100%)');
    elem.css('background','-ms-linear-gradient(top, rgba(218,108,37,1) 0%, rgba(255,175,75,0) 100%)');
    elem.css('background','linear-gradient(to bottom, rgba(218,108,37,1) 0%, rgba(255,175,75,0) 100%)');
    elem.css('padding','1px');
}
function redoFont(elem,size,weight,family) {
    elem.css('font-size', size);
    elem.css('font-family',family);
    if(weight != 'none') {
	elem.css('font-weight',weight);
    }
}
function doRSS() {
    $('#crosscol-overflow').css('position', 'absolute').css('top', '-23px').css('left', '670px');
    $('.footer-inner').css('padding', '0px 15px');
    $('#PageList1').append("<div id=rssDiv></div>")
    $("#rssDiv").append('<a href="http://opposing-opinions.blogspot.com/feeds/posts/default"></a>');
    $("#rssDiv").css('position', 'absolute').css('top', '52px').css('left', '878px').css('height', '32px').css('width', '32px').css('overflow', 'hidden').css('background-image', 'url("http://i.imgur.com/YVGtOre.png")').css('background-position', 'center bottom').css('background-repeat', 'no-repeat').css('cursor', 'pointer').css('z-index', '1');
    $(".blog-feeds").remove();
    $('.main-inner').css('padding-bottom', '0px');
 
}
function addBoxShadow(elem,dimen) {
    elem.css('-webkit-box-shadow',dimen);
    elem.css('-moz-box-shadow',dimen);
    elem.css('box-shadow',dimen);
}
$(document).ready(function () {
    // Begin OpOp Customization Calls
    // Written by the OpOp Team

    // Modify Header
    var titleWrapper = $('.titlewrapper');
    titleWrapper.children().html('Opposing Opinions');
    titleWrapper.children().attr('style','text-align:center; font-size:60px; width:938px; height:210px; font-family:Raleway; font-weight:100; color:#DB6D20; background-color:#333333;');
    addGradient(titleWrapper);
    titleWrapper.css('height', '70px');
    
    //change Tables
    //redoFont($('td'),'13px','none','PT Sans');
    $('td').css('font-size', '13px');
    $('td').css('font-family','PT Sans');
    
    var myContent = $('.content').html();
    $('.content').html( '<img id="compImage" src="http://i.imgur.com/PRCSGfh.png"><img id="gunsImage" src="http://i.imgur.com/aGyE8Ys.png">' + myContent);
    
    //style gun images
    $('#gunsImage').css('position','absolute');
    $('#gunsImage').css('left','20px');
    $('#gunsImage').css('overflow-y','hidden');
    $('#gunsImage').css('margin-top','-96px');
    
    //style tech images
    $('#compImage').css('position','absolute');
    $('#compImage').css('right','20px');
    $('#compImage').css('overflow-y','hidden');
    $('#compImage').css('margin-top','-96px');
    

    // Modify Footer
    $("#Attribution1 .widget-content").text("Powered by Puppies & Kittens.");
    
    // Modify Super 1337 Marquee Tag
    $('.header-inner').append('<marquee id="mySubTitles" behavior="alternate" scrollamount="3">'+pickSubtitle()+'</marquee>');
    redoFont($('#mySubTitles'),'25px','100','Waiting for the Sunrise');
    $('#mySubTitles').css('color','#DB6D20');
    
    // Modify Page's Link Styling
    $('#PageList1 ul li a').each(function(i){ redoFont($(this),'large','300','Raleway'); });
    $('.tabs-inner .widget li.selected a').css('background-color', '#DB6D20');
    $('.tabs-inner .widget li.hover a').css('background-color', '#DB6D20'); 
    
    // Modify Post Titles
    redoFont($('.post-title'),'300%','100','Raleway');
    
    // Build RSS Element
    doRSS(); 
    
    //Rss Hover Code
    $("#rssDiv").hover(function() {
       $("#rssDiv").css('background-position', 'center top');
    }, function() {
       $("#rssDiv").css('background-position', 'center bottom');
    });
    
    // RSS Click Code
    $("#rssDiv").click(function() { window.location=$(this).find("a").attr("href"); return false; });
    
    // Video should be 880 by 494
    var contentOuter = $('.content-outer');
    addBoxShadow(contentOuter,'3px 6px 47px 0px rgba(0,0,0,1)');
    //Video Box Shadow
    var myVideos = $('embed[type="application/x-shockwave-flash"]');
    addBoxShadow(myVideos,'4px 4px 24px 0px rgba(0,0,0,1)');
    //New Header Images Class
    var headerImages = $('.headerImages');
    addGradient(headerImages);
    addBoxShadow(headerImages,'4px 4px 24px 0px rgba(0,0,0,1)');
    //New Header Code class
    var headerCode = $('.headerCode');
    addBoxShadow(headerCode,'4px 4px 24px 0px rgba(0,0,0,1)');
    headerCode.css('border','1px dashed #DB6D20');

    //Modify Messege box
    var statusMsg = $('.status-msg-body');
    statusMsg.css('border','none');
    statusMsg.css('background-color','#333');
    statusMsgBorder = $('.status-msg-border');
    redoFont(statusMsg,'110%','100','Raleway');
    statusMsgBorder.css('border','none');
    $('.descriptionwrapper').remove();

    // CLEANUP / ARCHIVE
    
    //bankOpen();
    
    //headerImages.css('filter','progid:DXImageTransform.Microsoft.gradient( startColorstr=\'#da6c25\', endColorstr=\'#ffaf4b\', GradientType=0 )');
    
    //var statusMsg = $('.status-msg-body');
    //addBoxShadow(statusMsg,'3px 6px 47px 0px rgba(0,0,0,1)');
    //statusMsg.css('border','none');
    //statusMsg.css('background-color','#333');
    //statusMsgBorder = $('.status-msg-border');
    //redoFont(statusMsg,'110%','100','Raleway');
    //statusMsgBorder.css('border','none');
    
    //get current date CURRENTLY NOT USED  
    //var tempDate = new Date();
    //var monthNames = [ "January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December" ];
    //var theDate = monthNames[tempDate.getMonth()] + ' ' +tempDate.getDate() + get_nth_suffix(tempDate.getDate())  +  ', ' + tempDate.getFullYear();
    //$('.widget-content').children().children().attr('placeholder',theDate);
    
});

    
    
